#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>
char* my_strncat(char* dest, const char* src, size_t num)
{
	char* ret = dest;
	assert(dest != NULL);
	assert(src != NULL);
	while (*dest)
	{
		dest++;
	}
	for (int i = 0; i < num; i++)
	{
		if (*src == '\0')
			*dest++ = '\0';
		else
		*dest++ = *src++;
	}
	return ret;
}
int main()
{
	char arr1[20] = "abcdef";
	char arr2[20] = "abcdefghi";
	my_strncat(arr1, arr2, 7);
	printf("%s", arr1);
	return 0;
}